package cn.edu.scau.cmi.huxiantao.composite.consistent;

import java.util.Set;

public class ConsistentPerson implements ConsistentComponent {

	private String name;
	
	public ConsistentPerson(String name) {
		this.name=name;
	}
	
	@Override
	public String doSomething() {
		return "一致性个人:"+name+"\n";
	}
	@Override
	public String getName() {
		return this.name;
	}

	@Override
	public void addChild(ConsistentComponent child) {
		System.out.println("Person对象不能有孩子结点");
	}

	@Override
	public void deleteChild(ConsistentComponent child) {
		System.out.println("Person对象不能有孩子结点");
	}

	@Override
	public Set<ConsistentComponent> getChildren() {
		System.out.println("Person对象不能有孩子结点");
		return null;
	}

	@Override
	public void updateChildren(Set<ConsistentComponent> children) {
		System.out.println("Person对象不能有孩子结点");
	}

}
